#include<bits/stdc++.h>
int gcd(int a,int b){
	return a%b ? gcd(b,a%b) : b;
}
using namespace std;
int main(){
	int n1,n2,m1,m2,k;
	scanf("%d/%d %d/%d %d",&n1,&m1,&n2,&m2,&k);
	if(n1*m2>n2*m1){
		swap(n1,n2);
		swap(m1,m2);
	}
	int i = 1,flag = 0;
	while(i*m1<=n1*k){
		i++;
	}
	while(i*m2<n2*k){
		if(gcd(i,k)==1){
			if(flag) cout << " ";
			flag = 1;
			printf("%d/%d",i,k);
		}
		i++;
	}
	
	return 0;
}
